simplifying algebraic expressions with parentheses